home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Applications / Macintosh Tracker 1.20 / source / Server⁄Tracker 4.0 / channel.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-01  |  4.0 KB  |  140 lines  |  [TEXT/KAHL]

  1. /* channel.h */
  2.  
  3. /* $Id: channel.h,v 4.0 1994/01/11 17:43:33 espie Exp espie $
  4.  * $Log: channel.h,v $
  5.  * Revision 4.0  1994/01/11  17:43:33  espie
  6.  * Added prototypes.
  7.  *
  8.  * Revision 1.3  1994/01/05  14:54:09  Espie
  9.  * *** empty log message ***
  10.  *
  11.  * Revision 1.2  1994/01/05  01:59:14  Espie
  12.  * Added prototypes.
  13.  *
  14.  * Revision 1.1  1993/12/26  00:55:53  Espie
  15.  * Initial revision
  16.  *
  17.  * Revision 3.9  1993/11/17  15:31:16  espie
  18.  * audio_channel private.
  19.  *
  20.  * Revision 3.8  1993/11/11  20:00:03  espie
  21.  * Amiga support.
  22.  *
  23.  * Revision 3.7  1993/07/18  10:39:44  espie
  24.  * Cleaned up.
  25.  *
  26.  * Revision 3.6  1993/05/19  11:26:39  espie
  27.  * *** empty log message ***
  28.  *
  29.  * Revision 3.5  1992/11/27  10:29:00  espie
  30.  * General cleanup
  31.  *
  32.  * Revision 3.4  1992/11/23  10:12:23  espie
  33.  * *** empty log message ***
  34.  *
  35.  * Revision 3.3  1992/11/22  17:20:01  espie
  36.  * Simplified delay_pattern.
  37.  *
  38.  * Revision 3.2  1992/11/20  14:53:32  espie
  39.  * Added finetune.
  40.  *
  41.  * Revision 3.1  1992/11/19  20:44:47  espie
  42.  * Protracker commands.
  43.  *
  44.  * Revision 3.0  1992/11/18  16:08:05  espie
  45.  * New release.
  46.  *
  47.  * Revision 2.7  1992/11/13  13:24:24  espie
  48.  * Added parameters for extended Retriger command.
  49.  * Added transpose feature.
  50.  * Structured part of the code, especially replay ``automaton''
  51.  * and setting up of effects.
  52.  *
  53.  * Revision 1.5  1991/11/16  16:54:19  espie
  54.  * Bug correction: when doing arpeggio, there might not
  55.  * be a new note, so we have to save the old note value
  56.  * and do the arppeggio on that note.
  57.  * Added fields for arpeggio.
  58.  */
  59.  
  60.      
  61. #ifndef NUMBER_PATTERNS
  62. #define NUMBER_PATTERNS 128
  63. #endif
  64.  
  65. #define MAX_ARP 3
  66.      
  67. /* there is no note in each channel initially.
  68.  * This is defensive programming, because some
  69.  * commands rely on the previous note. Checking
  70.  * that there was no previous note is a way to
  71.  * detect faulty modules.
  72.  */
  73. #define NO_NOTE 255
  74.  
  75. struct channel
  76.    {
  77.    struct sample_info *samp;
  78.    struct audio_channel *audio;
  79.    int finetune;
  80.    int volume;             /* current volume of the sample (0-64) */
  81.    int pitch;              /* current pitch of the sample */
  82.    int note;               /* we have to save the note cause */
  83.                            /* we can do an arpeggio without a new note */
  84.     
  85.    int arp[MAX_ARP];       /* the three pitch values for an arpeggio */
  86.    int arpindex;           /* an index to know which note the arpeggio is doing */
  87.  
  88.    int viboffset;          /* current offset for vibrato (if any) */
  89.    int vibdepth;           /* depth of vibrato (if any) */
  90.  
  91.    int slide;              /* step size of pitch slide */
  92.  
  93.    int pitchgoal;          /* pitch to slide to */
  94.    int pitchrate;          /* step rate for portamento */
  95.  
  96.    int volumerate;         /* step rate for volume slide */
  97.  
  98.    int vibrate;            /* step rate for vibrato */
  99.  
  100.    int retrig;             /* delay for extended retrig command */
  101.    int current;
  102.                            /* current command to adjust parameters */
  103.    void (*adjust) P((struct channel *ch));
  104.    };
  105.  
  106. #define DO_NOTHING 0 
  107. #define SET_SPEED 1
  108. #define SET_SKIP 2
  109. #define SET_FASTSKIP 4
  110. #define SET_FINESPEED 32
  111.  
  112. #define JUMP_PATTERN 8
  113. #define DELAY_PATTERN 16
  114.  
  115. #define NORMAL_SPEED 6
  116. #define NORMAL_FINESPEED 125
  117.  
  118. struct automaton
  119.    {
  120.    int pattern_num;           /* the pattern in the song */
  121.    int note_num;              /* the note in the pattern */
  122.    struct block *pattern;     /* the physical pattern */
  123.    struct song_info *info;    /* we need the song_info */
  124.  
  125.    char gonethrough[NUMBER_PATTERNS + 1];  /* to check for repeats */
  126.  
  127.    int counter;               /* the fine position inside the effect */
  128.    int speed;                 /* the `speed', number of effect repeats */
  129.    int finespeed;             /* the finespeed, base is 100 */
  130.  
  131.    int do_stuff;              /* keeping some stuff to do */
  132.                               /* ... and parameters for it: */
  133.    int new_speed, new_note, new_pattern, new_finespeed;
  134.  
  135.    int pitch, note, para;     /* some extra parameters effects need */
  136.  
  137.    int loop_note_num, loop_counter;
  138.                               /* for command E6 */
  139.    };
  140.